﻿using System.Linq.Reactive;

namespace System.IO
{
    public static class FileSystemWatcherExtentions
    {
        public static IObservableEx<FileSystemEventArgs> ToObservable_Changed(this FileSystemWatcher Watcher)
        {
            return Watcher.FromEvent<FileSystemEventArgs>("Changed");
        }

        public static IObservableEx<FileSystemEventArgs> ToObservable_Created(this FileSystemWatcher Watcher)
        {
            return Watcher.FromEvent<FileSystemEventArgs>("Created");
        }

        public static IObservableEx<FileSystemEventArgs> ToObservable_Deleted(this FileSystemWatcher Watcher)
        {
            return Watcher.FromEvent<FileSystemEventArgs>("Deleted");
        }

        public static IObservableEx<FileSystemEventArgs> ToObservable_Disposed(this FileSystemWatcher Watcher)
        {
            return Watcher.FromEvent<FileSystemEventArgs>("Disposed");
        }
    }
}